Non-volatile memory systems, such as flash memory, are used in digital computing systems as a means to store data and have been widely adopted for use in consumer products. Flash memory may be found in different forms, for example in the form of a portable memory card that can be carried between host devices or as a solid state disk (SSD) embedded in a host device. In SSDs or other similar storage devices, a fine granularity mapping table is used to enable best write performance. The mapping table can typically be very large. The full table or subparts of it are used to perform read and write tasks. It is therefore desirable to store a working copy in dynamic random access memory (DRAM) to ease random read and write overhead.
However, it may not be economic or technologically viable to use a DRAM sufficiently large to hold the entire mapping table. If the entire mapping table is not held in DRAM, the mapping table is broken down into pieces, with only some (but not all) of the pieces stored in DRAM. In particular, non-volatile memory (such as flash memory) may store all “M” pieces of the mapping table, and DRAM may store a working copy of “N” pieces of the mapping table, where N<M.
Previous solutions have attempted to select which of the pieces should be held in DRAM. One solution is to disallow any swapping of pieces between DRAM and flash memory. In this solution, the N pieces are stored in DRAM and are not swapped regardless of the reads or writes to memory. Another solution is to swap pieces constantly. In this solution, if a piece of the mapping table is necessary for access and not included in the DRAM, the piece is copied to DRAM. Still another solution is a swapping scheme based on counting of hits over a period of time and comparing the hits to a threshold. Each of these solutions suffers from inefficiently managing the pieces of the mapping table in DRAM.